/*
 * commons is a based project implemented
 * Copyright (C) 2024 Jasmine
 */
package com.commons.web.validate;

import com.commons.web.validate.parser.*;

/**
 * 错误码列表-通用错误码
 *
 * @author Jasmine
 * @version 1.0
 * @date 2021-01-27 8:41:41
 * @see RuleType
 * @since JDK1.8
 */
public enum RuleType {

    NULL("参数为空", NullParser.class),
    NOT_NULL("参数为空", NotNullParser.class),
    EMPTY("参数为空", EmptyParser.class),
    NOT_EMPTY("参数不为空", NotEmptyParser.class),
    EMAIL("邮箱错误", EmailParser.class),
    MOBILE("手机号错误", MobileParser.class),
    PATTERN("正则校验失败", MactchRegexParser.class),;

    private String message;

    private Class<? extends RuleParser> parser;

    RuleType(String message, Class<? extends RuleParser> parser) {
        this.message = message;
        this.parser = parser;
    }

    public String getMessage() {
        return message;
    }

    public Class<? extends RuleParser> getParser() {
        return parser;
    }

}
